Skip to content

ci(pr-automation): run Check Changeset on open PRs only - #35950

Merged
os-zhuang merged 1 commit into
mainfrom
claude/area-a4A-35949
Nov 21, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/area-a4A-35949

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #35949
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感。已经合并的拉取请求,事后被车队摘掉待合并标签时,不再冒出一个红色的变更说明检查;仍开着的拉取请求照旧每次都检查。
  • 为什么做:替维护者解决误报。合并后的那次标签变动让检查拿主干上自己的合并提交作比较基点,数出零份变更说明而报红,前两天两次被当成合并坏了。
  • 出错会怎样:最坏是某个开着的拉取请求漏掉一次变更说明检查;只改一行流水线条件,直接撤回本次合并即可复原。
  • 要你做什么:这次改的是 CI 工作流,属人工合并档(Tier H)。需要你或 os-zhuang / hotlong 批准后合并。

What changes

.github/workflows/pr-automation.yml, job changeset-check only: its job-level if: gains a first conjunct, github.event.pull_request.state == 'open', plus a five-line comment naming the post-merge unlabeled pm:awaiting-merge event, #35842 (run 44739836712, which logged Diff base: 9a28a480d2, that PR's own merge commit) and #35857.

Why the guard is the whole fix: on a closed PR, merge-base origin/main HEAD is the PR's own merge commit once main holds it, so the step counts zero added changesets and fails. A closed PR's verdict is final and has nothing left to gate. Open PRs (drafts included: their state is open) keep every run they have today, on all six subscribed actions. pr-size and auto-label already exclude label and edited events and are untouched.

Premise re-measured on origin/main 170ca48 before the edit: the if: carried only the skip-changeset label term and the release-PR term, no PR-state guard.

Whole PR: 7 added, 1 deleted, net 6 lines. No changeset: .github/** ships in no package, so this PR takes the skip-changeset label (route 2).

Tests

No unit-tested behaviour changed (workflow config), so no ablation. Every repo check that parses this workflow was run at d508b3a, all exit 0:

  • node scripts/pm/check-expected-skips.mjs --self-test (209 cases) and --roster: Check Changeset stays rostered as a skip-changeset opt-out, now "plus 2 further condition(s) the recogniser does not read". The self-test fixture models the old if: text by hand; nothing compares it with the real file, so it needed no update.
  • pnpm check:workflow-status-functions and its --self-test; node scripts/check-empty-changeset.mjs --self-test (167, including the consumer pins that slice the Check Changeset job); node scripts/check-changeset-no-major.mjs --self-test; node scripts/pr-labels.mjs --self-test; node scripts/check-whole-set-label-write.mjs and --self-test.
  • All 36 commands node scripts/pm/dispatch-gates.mjs --commands derived for this diff (including pnpm check:pm-dispatch-gates, fast tier, 2249 cases): readings in the details block below.
Local gate readings at d508b3a (41 commands, all exit 0; --ran: 36 derived families accounted for, 0 NOT-MEASURED, a derived zero)
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-step-collectors.mjs :: exit 0
node scripts/check-step-collectors.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:aggregator-roster :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:declared-population-live :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:node-version :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pnpm-acquisition :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:required-contexts :: exit 0
pnpm check:shard-attestation :: exit 0
pnpm check:stall-guard-budget :: exit 0
pnpm check:stall-guard-headroom :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:workflow-status-functions :: exit 0
pnpm check:workflow-step-name-quoting :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --self-test :: exit 0
node scripts/pr-labels.mjs --self-test :: exit 0
node scripts/pm/check-expected-skips.mjs --self-test :: exit 0
node scripts/pm/check-expected-skips.mjs --roster :: exit 0
node scripts/check-workflow-status-functions.mjs --self-test :: exit 0
pnpm check:pm-dispatch-gates :: exit 0

Acceptance notes

  • actionlint is not installed in this container: NOT MEASURED locally. The edited if: parses with the yaml package to the expected single expression.
  • The merge_group and push events never reach this workflow (it subscribes to pull_request only), so the new term cannot skip a queue build.

Verification

Read first: .github/workflows/pr-automation.yml, the changeset-check if: hunk (the only risk: a wrong spelling would skip the gate on open PRs too).

Two-minute check: on any open PR without skip-changeset, Check Changeset still runs on every event; on a PR merged after this one lands, removing a label now leaves Check Changeset skipped instead of failure. GitHub reads the workflow at the event's commit, so PRs merged before this one (#35842, #35857, and any later post-merge label event on them) keep the old behaviour. The first live proof is this PR's own post-merge unlabeled pm:awaiting-merge.

Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv

🤖 Generated with Claude Code

A label event on a merged PR (the fleet's post-merge `unlabeled
pm:awaiting-merge`) ran the changeset-check job, whose diff base
`merge-base origin/main HEAD` is then the PR's own merge commit: it counted
zero changesets and left a false red on a head that shipped one. Guard the
job-level `if:` on `github.event.pull_request.state == 'open'`.

Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1ZJL93Kin2UHFXbFv

Changeset route 2 · 2026-11-20T22:47Z: this PR changes .github/workflows/pr-automation.yml only. .github/** ships in no package, so the PR releases nothing and takes skip-changeset. No .changeset/*.md row is added, changed or deleted, so route 0 does not apply.

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4cwxJaQdC11ABGtTez8

L1 verdict (L1-a): ACCEPT at head d508b3a59dad0459ce75f7f8c66a46e73ad68b02 (Fixes #35949: Check Changeset no longer runs, and goes red, on a merged PR's post-merge label event). It delivers the card. No blocker, and nothing owed.

Gates on this head: l1-face --pr 35950: 12 items ok, and all-checks flagged only for the stale red described in the note below. Check-runs at d508b3a: 29 success, 18 skipped, 0 pending, and one failure, which is that stale opened run of Check Changeset. Lint & Repo Gates and TypeScript Type Check both success. GitHub reads mergeable_state: clean. Dogfood battery not owed.

What I checked:

  • The fix is the right one. pr-automation.yml subscribes pull_request with [opened, synchronize, reopened, labeled, unlabeled, edited]. closed is not in the list, so the only way a closed PR reaches this job is a label or edit event after close. On such an event, github.event.pull_request.state is closed, and the new first conjunct skips the job. On every subscribed event of an open PR, drafts included, it is open, so open PRs keep every run they had. The card's premise is right. skills(automation): the approvals reference says a reject carries its reason #35842's red run 44739836712 is the unlabeled pm:awaiting-merge event 32 minutes after its merge, and it logged its own merge commit as the diff base.
  • The expression parses as intended. I parsed the workflow at this head with the yaml package. jobs.changeset-check.if is one line: github.event.pull_request.state == 'open' && !contains(…'skip-changeset') && !(github.head_ref == 'changeset-release/main' && github.event.pull_request.user.login == 'github-actions[bot]'). The release-PR exemption keeps its own parentheses, so the new && does not change how it groups. actionlint was not run (the PR says so). The workflow did load and run on this head, which a syntax error would have prevented.
  • Nothing downstream depends on the job. The only needs: in the file is auto-label → pr-size. A skipped changeset-check therefore skips no other job.
  • Pins of the if: text. git grep for the label term finds only the workflow and scripts/pm/check-expected-skips.mjs. I ran check-expected-skips --roster at this head. It still reads Check Changeset as the skip-changeset opt-out, "plus 2 further condition(s) the recogniser does not read", so the expected-skip classification holds.
  • Other workflows on label events. unlabeled appears in one other workflow file, publish-smoke.yml, and only in a comment: that workflow runs on workflow_run. pr-size and auto-label in this file already skip label and edit events. So this job is the only one the post-merge event reached, as the card says.
  • skip-changeset. The only file touched is .github/workflows/pr-automation.yml, which no package ships. l1-face reads "no published package touched (unpublished: @objectstack/spec-monorepo)". objectstack-fleet[bot] hung the label at 22:48:14Z, with the route-2 reason in comment 7052499295. No classifier refused it, so it is not a dev's refused label carried by someone else.
  • Fixes is right. All three Done-when items are met: the guard, open PRs unchanged, and no pin owed an update.
  • The body. One closing keyword (Fixes #35949). The other card numbers (skills(automation): the approvals reference says a reject carries its reason #35842, docs(skills): ask trigger cases, and automation sends a non-branching wizard to ui #35857) appear without verbs.

One note on the red check (not owed): the opened run of Check Changeset at 22:45:24Z is red (job 136617359681), because the label landed about three minutes after creation, outside the settling read's window. The labeled run at 22:48:19Z is skipped, and it is the latest run of that name on this head, so it is what counts. GitHub agrees: mergeable_state is clean. a4-A should read it that way at landing and not re-run the red one (a re-run replays the frozen payload, #5580). The fleet's checklist also asks for a skip-changeset comment that carries both the dev's word and the seat's own check. Comment 7052499295 carries one reason. The reason is true, and I confirmed it above.

Landing: not governed. a4-A lands once every check is green.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF

Served-tier: CONTRACT_REVIEW_TIER

Contract review — PASS at d508b3a

Head-sha: d508b3a59dad0459ce75f7f8c66a46e73ad68b02
Local-runs: none
Scope: .github/workflows/pr-automation.yml + none
Security-touching: yes

Isolated L2 review of PR #35950 (Fixes #35949) on the rules face: the governed path .github/workflows/**. Read: the card and its four comments, the PR body, the one-file diff against main (7 added, 1 deleted), the check-runs on this head, ruling record 6722205630 and its card #31538, and the logs of the two runs the card cites. Check-runs on this head, read 2026-11-20T23:15Z: 29 success, 18 skipped, 1 red (the stale opened run of Check Changeset, see ③).

No must-fix, no should-fix. Three nits (N1 to N3) and one landing flag, which is the first item of ③ and the thing to read first.

① Derived judgments

  • The expression. One hunk, in job changeset-check: the job-level if: gains a first conjunct, github.event.pull_request.state == 'open', under a five-line comment. All four lines of the folded scalar sit at one indentation, so it still folds to a single expression: state is open, AND no skip-changeset in the payload, AND NOT (release branch AND release bot). The release-PR exemption keeps its own parentheses, so the new && regroups nothing. Right.
  • An open PR loses no run, on any event. on: is untouched: pull_request with opened, synchronize, reopened, labeled, unlabeled, edited. Every one of the six carries the PR object, and its state is open for an open PR, a draft included; reopened is delivered after the transition, and synchronize exists only for an open PR. Measured on this head, not only argued: run 44831520471 (this PR's own opened event, a draft) evaluated the head's if: and ran the job through every step (job 136617359681). Right.
  • ready_for_review and merge_group. Neither is subscribed at the base or at the head, so neither reaches this job, and the diff does not change that. ready_for_review would carry state: open if it were ever added. merge_group carries no PR object: see N1.
  • Closed and merged PRs. On a label or edit event the payload says closed, the conjunct is false and the job reports skipped. The premise holds in the logs. skills(automation): the approvals reference says a reject carries its reason #35842: its post-merge unlabeled pm:awaiting-merge started run 44739836712 about 32 minutes after the merge; the checkout pinned origin/main to the PR's own merge commit 9a28a48, the step logged that commit as the diff base and counted 0 changesets. docs(skills): ask trigger cases, and automation sends a non-branching wizard to ui #35857: three green runs, then a red one eight seconds after the same post-merge event. Right, within the boundary N2 names.
  • Merge queue: unchanged. Five workflows subscribe merge_group (ci.yml, lint.yml, governed-surface-guard.yml, pr-body-guards.yml, spec-liveness-check.yml); this one never did. Check Changeset is not a required context: the live ruleset on main (12119582) requires eleven, and it is not among them. So a skipped or absent Check Changeset neither satisfies nor blocks a required status, before or after this diff. Nothing needs: the job, and no workflow_run consumer names PR Automation. Right.
  • Permissions and token: nothing widened. No permissions: line is added, changed or moved (the job block is still contents: read, pull-requests: write; the file has no workflow-level block). No secrets, github.token or uses: line changes. The trigger stays pull_request, never pull_request_target. The job now starts on fewer events than before. Right.

② Semver level

  • skip-changeset is right. The only path is .github/workflows/pr-automation.yml, which no package ships, so the diff publishes nothing (AGENTS.md, Post-Task Checklist item 3). The route-2 reason is on the PR (comment 7052499295). No .changeset/*.md row is added, changed or deleted, so route 0 does not apply.
  • Clause-②: no and Metadata-protocol: none both stand line-initial in the PR body, and both are right: no accept-set, export or authorable key moves. There is no changeset, so there is no second copy to compare.
  • One closing keyword, Fixes #35949. The card's three Done-when items are met, the first within N2's boundary; no repo check pins this if: text (the check-expected-skips fixture is a frozen model, compared with nothing).

③ Boundary flags

  • Landing is Tier H, and two comments here say otherwise. check-governed-merges.mjs --pr 35950 reads the path under ruling record 6722205630, letter C, and names two C2 triggers: an if: changed on a job that already ran, and a changed job that holds a write token. So this PR lands by the maintainer's merge or enqueue, or on an authorized APPROVED review and then the owning seat (AGENTS.md, Prime Directive 14). The card's claim comment (7052031713) and the L1 ACCEPT (7052735589: "Landing: not governed. a4-A lands once every check is green.") are wrong on this point and are not to be acted on. No seat readies, queues or arms auto-merge on this PR, and this PASS lifts none of that. State as read: draft, no auto-merge, no review, so nothing has to be undone. The rest of letter C holds: C1, the workflow edit rides its own PR (one file); C3 does not apply.
  • N3 (nit) — the PR body's 维护者速读 says 「要你做什么:无。」. Under Tier H the maintainer's approval or merge is exactly what is owed. A body edit, no head move.
  • The red Check Changeset on this head is the opened run, on a payload frozen before the label landed: the label arrived 176 s after creation, outside the 120 s settling window. The labeled run after it is skipped and is the newest of that name. Re-running the red one replays the same payload and stays red. Not a defect of the diff.
  • Dev report: open_questions is empty; security_findings is none, and I found none. "actionlint NOT MEASURED" is answered by the head's own runs: the workflow loaded and the edited job ran on this head. The three declared deviations (probe-push order, the model-free trailer pair, "Tests" in place of "Evals") touch nothing reviewed here, and the commit carries the AGENTS.md trailer pair.
  • SQL push-down: not applicable, the diff holds no query code.
  • On the security line above, yes is meant: the hunk changes when a job that holds pull-requests: write runs. I found no security defect. The value it reads is the platform's own state field, used in an if: and never in a shell line. A PR author can move it only by closing the PR, which cannot merge while closed, and reopening fires reopened, which runs the job.

④ Design judgment

.github/workflows/pr-automation.yml, judged against the card's scenario and ruling record 6722205630.

  • The guard sits at the right layer and closes the class. on.pull_request has no state filter, so a job-level if: is the only place a workflow can decline a closed PR. A change to the fleet's tidy step instead would leave every other post-merge label or edit event red. A closed PR gates nothing, and one that is reopened gets a fresh run from reopened, so no stale cell is left behind.
  • It cannot be used to switch the gate off for a PR that can still merge. See the last item of ③ and the second item of ①.
  • N1 (nit) — polarity when the event has no PR. == 'open' reads an absent state as "skip"; every other unreadable input in this job resolves to "enforce", as its own comments on the label reads say. Unreachable today: the trigger set is pull_request only, and widening it is itself a Tier H edit under letter C. != 'closed' would keep the enforcing direction and change nothing for a real PR. Accepted deviation on this head; revisit if the trigger set ever grows.
  • N2 (nit) — where the guard takes effect. A pull_request run on a merged PR executes at that PR's own merge commit (run 44739836712 checked out 9a28a48 as main), and GitHub reads the workflow file at the event's commit. So the guard reaches PRs merged after this one lands, and none merged before it. skills(automation): the approvals reference says a reject carries its reason #35842 and docs(skills): ask trigger cases, and automation sends a non-branching wizard to ui #35857 stay red: a re-run replays the same payload on the same commit. A PR already merged when this lands still goes red when its pm:awaiting-merge is removed later. The PR body's two-minute check ("on a merged PR, removing a label now leaves Check Changeset skipped") holds only for a PR merged after it; the body should say so. The first live proof is this PR's own post-merge unlabeled.
  • After the guard, the newest Check Changeset on a merged PR reads skipped instead of its last real result. Neutral, and better than a false red. check-expected-skips still rosters the name: it reads the label term and counts the other two conjuncts as unread, and the head's lint lanes are green on it.

Implemented-by: claude/area-a4A-35949
Reviewed-by: session_016WV4d1PJ4isQ3eD7Fk1fnF

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF

席位核对 — ACCEPT · repo:objectstack#4 · head d508b3a59dad0459ce75f7f8c66a46e73ad68b02

  1. 形态 — Fixes ci: Check Changeset re-runs on a merged PR's label event and goes red against the main that already holds its changeset #35949(p1,回应维护者 2026-11-20 22:18Z 「35842 红了」);仅改 changeset-check 作业的 if:。
  2. 前提实测 — 开着的 PR 在 opened / synchronize / reopened / labeled / unlabeled / edited / ready_for_review 下照常运行;merge-queue 行为不变;权限块未动。
  3. 门禁 — CI 完成,mergeable clean;唯一红叉为旧的 opened 运行(L1 判定不重跑);check-governed-merges:GOVERNED,Tier H(人合)。
  4. 接受的偏差 — N1 无载荷事件下 == 'open' 会跳过:今日不可达。
  5. 范围外去向 — N2 本守卫只管落地后合并的 PR,skills(automation): the approvals reference says a reject carries its reason #35842、docs(skills): ask trigger cases, and automation sends a non-branching wizard to ui #35857 的旧红叉保留(仅显示,主干是绿的)。N3 正文「要你做什么:无」在 Tier H 下不对,本区改为请审批。
  6. 落地条款 — pm:awaiting-merge + 请 GOVERNED_APPROVERS(os-zhuang / hotlong)复核;APPROVED 后经队列落地,或维护者亲合。席位不翻 ready、不入队。head 若移动,本记录与合约复审皆失效重核。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1ZJL93Kin2UHFXbFv

Awaiting a governed merge · 2026-11-20T23:17Z · head d508b3a59dad0459ce75f7f8c66a46e73ad68b02

  • check-governed-merges --pr 35950 reads this PR as GOVERNED, Tier H (人合). The path is .github/workflows/**, and ruling 6722205630 letter C applies because an if: changed on changeset-check, a job that holds a write token. This overrides the "not governed" lines in claim 7052031713 and L1 7052735589.
  • Records at this head: L1 ACCEPT 7052735589 and seat 4's contract PASS 7052966826. The PR body was updated for N2 (the guard reaches only PRs merged after this one) and N3 (the maintainer's approval is owed). The head has not moved.
  • CI: 29 success. The one red is the stale opened run of Check Changeset. The labeled run after it is skipped. Do not re-run the red one (Check Changeset 从事件载荷读 skip-changeset 标签:开 PR 后 5 秒内加标签,首个 run 永久红(重跑复用载荷)—— 一日三例 #5580).
  • Requested reviewers: os-zhuang, hotlong. The PR stays draft, with no ready, enqueue or auto-merge from a seat, until a governed approver APPROVES.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 20, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 21, 2026 03:05
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit b34a12b Nov 21, 2026
57 of 58 checks passed
@os-zhuang
os-zhuang deleted the claude/area-a4A-35949 branch November 21, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: Check Changeset re-runs on a merged PR's label event and goes red against the main that already holds its changeset

2 participants